﻿using Domain.Entitys.Sinv;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.IRepositorys.Sinv
{
    public interface ISinv_Sale_ReturnRepository
    {
        /// <summary>
        /// 分页条件查询销售退货订单
        /// </summary>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        List<Sinv_Sale_Return_Info> GetSinv_Sale_Return_Infos(int currentPage, int pageSize, string customerName, string orderCode, int orderStatus, char auditStatus);

        /// <summary>
        /// 条件查询销售订单总数
        /// </summary>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnCountAsync(string customerName, string orderCode, int orderStatus, char auditStatus);

        /// <summary>
        /// 添加销售退货信息及其详情
        /// </summary>
        /// <param name="sinv_Sale_Return"></param>
        /// <param name="sinv_Sale_Return_Details"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnAddAsync(Sinv_Sale_Return sinv_Sale_Return,List<Sinv_Sale_Return_Details> sinv_Sale_Return_Details);

        /// <summary>
        /// 根据销售退货编号查询对应销售退货信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<Sinv_Sale_Return> Sinv_Sale_ReturnByCodeAsync(string code);

        /// <summary>
        /// 根据销售退货编号查询对应销售退货明细
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<List<Sinv_Sale_Return_Details>> Sinv_Sale_Return_DetailsByCodeAsync(string code);

        /// <summary>
        /// 修改销售退货信息及其详情
        /// </summary>
        /// <param name="sinv_Sale_Return"></param>
        /// <param name="sinv_Sale_Return_Details"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnUpdateAsync(Sinv_Sale_Return sinv_Sale_Return, List<Sinv_Sale_Return_Details> sinv_Sale_Return_Details);

        /// <summary>
        /// 修改销售退货审核状态，增加库存，增加销售订单明细退货数量，修改订单状态
        /// </summary>
        /// <param name="sinv_Sale_Return"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnAuditUpdateAsync(Sinv_Sale_Return sinv_Sale_Return);

        /// <summary>
        /// 逻辑删除销售退货信息，并减少销售明细预计退货数量
        /// </summary>
        /// <param name="sinv_Sale_Return"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnDelAsync(Sinv_Sale_Return sinv_Sale_Return);
    }
}
